Skip to content

Deprecate table client scan_query in favor of QueryService - #893

Open
vgvoleg wants to merge 2 commits into
mainfrom
deprecate-scan-query
Open

Deprecate table client scan_query in favor of QueryService#893
vgvoleg wants to merge 2 commits into
mainfrom
deprecate-scan-query

Conversation

@vgvoleg

@vgvoleg vgvoleg commented Sep 3, 2026

Copy link
Copy Markdown
Member

TableClient.scan_query, TableClient.async_scan_query and the async scan_query now raise DeprecationWarning and point to QueryService (ydb.QuerySessionPool).

No behaviour change beyond the warning — the methods still work.

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.41%. Comparing base (8ce506e) to head (7dcf6ce).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #893      +/-   ##
==========================================
+ Coverage   82.36%   82.41%   +0.04%     
==========================================
  Files          99       99              
  Lines       12753    12759       +6     
  Branches     1242     1242              
==========================================
+ Hits        10504    10515      +11     
+ Misses       1795     1790       -5     
  Partials      454      454              
Flag Coverage Δ
integration 80.19% <83.33%> (+<0.01%) ⬆️
unit 48.75% <100.00%> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
ydb/aio/table.py 80.42% <100.00%> (+0.10%) ⬆️
ydb/table.py 67.07% <100.00%> (+0.37%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Khabib73 Khabib73 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new docstrings use an invalid Sphinx .. deprecated:: directive form (missing required version) and the new warning behavior lacks accompanying tests to prevent regressions.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR deprecates the legacy Table client scan query APIs by emitting DeprecationWarning at runtime and documenting the deprecation, steering users toward QueryService (QuerySessionPool) while keeping existing functionality intact.

Changes:

  • Added DeprecationWarning emission for TableClient.scan_query, TableClient.async_scan_query, and ydb.aio.TableClient.scan_query.
  • Introduced a shared deprecation message constant used across sync/async implementations.
  • Added a top-of-file CHANGELOG.md entry describing the deprecation.
File summaries
File Description
ydb/table.py Adds shared deprecation message and emits DeprecationWarning from the sync and “async_*” TableClient scan query methods; adds deprecation docstrings.
ydb/aio/table.py Emits DeprecationWarning from the async table client scan_query and reuses the shared deprecation message.
CHANGELOG.md Documents the deprecation as user-facing behavior.
Review details

Suppressed comments (2)

ydb/table.py:1225

  • Same issue here: .. deprecated:: without a version argument is invalid in Sphinx and may break autodoc builds. Prefer a plain-text deprecation note (or add an explicit version).
        """
        .. deprecated::
            Use QueryService (:class:`ydb.QuerySessionPool`) instead.
        """

ydb/table.py:1291

  • Same Sphinx directive issue: .. deprecated:: without a version argument is invalid and can fail doc generation. Replace with plain text or include a version.
        """
        .. deprecated::
            Use QueryService (:class:`ydb.QuerySessionPool`) instead.
        """
  • Files reviewed: 3/3 changed files
  • Comments generated: 5
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ydb/table.py
Comment thread CHANGELOG.md Outdated
Comment thread ydb/aio/table.py
Comment thread ydb/table.py
Comment thread ydb/table.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants